package mx.com.crowdgine.assetloader.audio;

public class AudioManager{
	Audio currentAudio;
	
	public AudioManager(String filename){
		try{
			
			if(filename.endsWith(".mid")){
				currentAudio=new MidiAudio();
			}
			else if(filename.endsWith(".wav")){
				currentAudio=new WavAudio();
			}
			
			currentAudio.load(filename);
		}
		catch(Exception e){
			System.out.println("Audio could not be loaded properly");
		}
	}

	public void play(){
		currentAudio.play();
	}
	
	public void stop(){
		currentAudio.stop();
	}
}
